@model IList<SystemWarningModel>

@{
    //page title
    ViewBag.Title = T("Admin.System.Warnings").Text;
    //active menu item (system name)
    Html.SetActiveMenuItemSystemName("Warnings");
}

<div class="content-header clearfix">
    <h1 class="pull-left">
        @T("Admin.System.Warnings")
    </h1>
    <div class="pull-right">
        &nbsp;
        @await Component.InvokeAsync("AdminWidget", new { widgetZone = AdminWidgetZones.WarningsButtons })
    </div>
</div>

<div class="content">
    <div class="form-horizontal">
        <div class="panel-group">
            @await Component.InvokeAsync("AdminWidget", new { widgetZone = AdminWidgetZones.WarningsTop })
            <div class="panel panel-default">
                <div class="panel-body">
                    @foreach (var warning in Model)
                    {
                        switch (warning.Level)
                        {
                            case SystemWarningLevel.Pass:
                                {
                                    <p class="text-green">
                                        <i class="icon fa fa-check"></i>
                                        @if (warning.DontEncode)
                                        {
                                            @Html.Raw(warning.Text)
                                        }
                                        else
                                        {
                                            @warning.Text
                                        }
                                    </p>
                                }
                                break;
                            case SystemWarningLevel.CopyrightRemovalKey:
                            case SystemWarningLevel.Recommendation:
                            case SystemWarningLevel.Warning:
                                {
                                    <p class="text-yellow">
                                        <i class="icon fa fa-warning"></i>
                                        @if (warning.DontEncode)
                                        {
                                            @Html.Raw(warning.Text)
                                        }
                                        else
                                        {
                                            @warning.Text
                                        }
                                    </p>
                                }
                                break;
                            case SystemWarningLevel.Fail:
                                {
                                    <p class="text-red">
                                        <i class="icon fa fa-ban"></i>
                                        @if (warning.DontEncode)
                                        {
                                            @Html.Raw(warning.Text)
                                        }
                                        else
                                        {
                                            @warning.Text
                                        }
                                    </p>
                                }
                                break;
                        }
                    }
                </div>
            </div>
            @await Component.InvokeAsync("AdminWidget", new { widgetZone = AdminWidgetZones.WarningsBottom })
        </div>
    </div>
</div>